docs(patterns): URL contract accuracy fixes from fn-182.5 codex review - #4
Merged
Conversation
…l review
- Drop the %3A -> %253A href round-trip double-encode claim from the
pinned-divergences bullet: it reproduces on Foundation's
URLComponents.queryItems construction path, NOT the plain URL(string:)
parse -> absoluteString path the injected global uses (Desktop's
JSCURLCoherenceTests.testPreEncodedQueryRoundTripComputedRow pins
verbatim %3A preservation). Replaced with an explicit
queryItems-only correction note.
- Qualify the TypeError contract: scheme-less/scheme-relative input
throws only WITHOUT a valid absolute base (new URL('/api', base)
resolves); a bad base throws first.
- Byte-ceiling trims within §24 (parse-coherence bullet, guard comment,
intro) keep the compiled factory context at 179175 B under the 175 KB
fn-56 ceiling; regen via compile-factory-context.sh; npm run check
green (freshness + verify-knowledge + compiled freshness)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two teaching-accuracy fixes in
reference/patterns.md§24 (Guarded URL parsing), flagged by the codex impl review of AppOS-Desktop task fn-182.5 (bundled factory-context regen):Double-encode claim corrected (Major): the pinned-divergences bullet claimed pre-encoded query values double-encode on an
hrefround-trip (%3A→%253A). That divergence reproduces on Foundation'sURLComponents.queryItemsconstruction path — NOT on the plainURL(string:)parse →absoluteStringpath the injectedURLglobal uses. Desktop's own merged test (JSCURLCoherenceTests.testPreEncodedQueryRoundTripComputedRow, PR #140) pins verbatim%3Apreservation. Teaching the false divergence could prompt generated plugins into harmful compensating encoding. Replaced with an explicit "queryItems-only" correction note.TypeError contract qualified (Minor): "throws on scheme-less or unparseable input" now reads: throws on unparseable input, and on scheme-less/scheme-relative input lacking a valid absolute
base(new URL('/api', 'https://x.test')resolves); a badbasethrows first. The old wording contradicted the documentednew URL(url, base?)resolution contract.Plus small byte-ceiling trims within §24 (parse-coherence bullet, guard comment, intro) so the compiled factory context stays under the 175 KB fn-56 ceiling: 179,175 B (25 B headroom; it was 13 B pre-change).
Regen + gates
compile-factory-context.shregen included (compiled/plugin-factory-context.md+compiled/manifest.json);--checkgreen in both reposnpm run checkgreen: SDK mirror freshness + verify-knowledge (69 fences) + compiled freshnessCoordination
--checkstays green against dev-plugin main (same dev-plugin-first ordering as fn-165)url-mirror-3.0.1) also touchescompiled/manifest.json; whichever merges second should re-runcompile-factory-context.shif the merge conflicts (the context bytes themselves are independent — PR chore(sdk): refresh byte-pinned mirror to plugin-types@3.0.1 (fn-182.4 mirror order) #3's mirror refresh is compiled-context byte-identical)